package com.lyfam.game.entity;

import processing.core.PGraphics;

import com.lyfam.game.geometry.Vector2D;

public class Obstacle extends BaseGameEntity implements IRenderable
{
	private static final float BORDER_WIDTH = 5;
	
    @Override
	public float getBoundary()
	{
		return getSize() + BORDER_WIDTH;
	}

	private boolean showCenter = false;
    
    public boolean isShowCenter()
    {
        return showCenter;
    }

    public void setShowCenter(boolean showCenter)
    {
        this.showCenter = showCenter;
    }

    public Obstacle(Vector2D v)
    {
        this.position = v;
    }

    public void render(PGraphics g)
    {
        this.render(g, getSize());
    }

    public void render(PGraphics g, float width, float height)
    {
        float x = position.getX();
        float y = position.getY();
        g.ellipse(x, y, width, height);
        if (showCenter)
        {
            g.line(x - 2, y + 2, x + 2, y - 2);
            g.line(x - 2, y - 2, x + 2, y + 2);
        }
    }

    public void render(PGraphics g, float radius)
    {
        this.render(g, radius*2, radius*2);
    }

	@Override
	public void update()
	{
		
	}
}
